import { createBrowserRouter } from 'react-router-dom';
import Layout from '@/components/layout';
import NotFound from '@/components/NotFound';
import Register from "@/pages/Register"
import Home from '@/pages/home';
import SecondPage from '@/pages/secondPage';

// about
import WhoWeAre from "@/pages/about/who-we-are"
import MemerberListing from "@/pages/about/member-listing"
import ContactUs from "@/pages/about/contact-us"

//discover
import OpenData from "@/pages/discover/open-data";
import DataDetail from "@/pages/discover/open-data/dataDetail"


// 头部静态路由配置
const staticRouter = [{
    path: '/',
    element: <Layout />,
    children: [{
        index: true,
        element: <Home />
    }, {
        path: "about/",
        children: [{
            path: "who-we-are",
            element: <WhoWeAre />
        }, {
            path: "member-listing",
            element: <MemerberListing />
        }, {
            path: "contact-us",
            element: <ContactUs />
        }]
    },{
        path: "discover/",
        children: [{
            path: "open-data",
            element: <OpenData />
        }]
    }]
}]


const router = createBrowserRouter([
    ...staticRouter,
    {
        path: '/',
        element: <Layout />,
        children: [{
            path: "second",
            element: <SecondPage />
        }, {
            path: "/register",
            element: <Register />
        },{
            path: "/discover/open-data/detail",
            element: <DataDetail />
        }]
    }, {
        path: "*",
        element: <NotFound />
    }
])
export default router;


